<extend name="Base/common" />
<block name="Content">
    <div class="am-cf am-padding-top">
        <div class="am-fl am-cf">
            <i class="am-icon-file"></i>
            <strong class="am-text-primary am-text-lg">{$userModel['username']}（{$userModel['account']}）住址管理</strong>
        </div>
        <hr data-am-widget="divider" class="am-divider am-divider-default" />
    </div>
   
   <div class="am-u-sm-12 am-u-md-6" style="padding:0px">
       <div class="am-btn-toolbar">
           <div class="am-btn-group am-btn-group-xs">
               <a class="am-btn am-btn-success" href="{:U('editAddressAction', 'user_id='.$userModel['user_id'])}">
               	<span class="am-icon-plus"></span>&nbsp;新增
               </a>
               <a class="am-btn am-btn-secondary" onclick="javascript:history.back(-1);return false;">
               	<span class="am-icon-plus"></span>&nbsp;返回
               </a>
           </div>
       </div>
   </div>
   
       <div class="am-fr am-padding-right am-u-md-3">
            <form class="am-form" action="{:U('addressIndex')}" method="post">
                <div class="am-input-group am-input-group-sm">
                    <input type="text" class="am-form-field am-input-sm" placeholder="联系人姓名或地址" name='param' value="{$param}"/>
                    <span class="am-input-group-btn">
                        <button class="am-btn am-btn-default" type="submit">
                            搜索
                        </button>
                    </span>
                </div>
			</form>
       </div>
  
    <table class="am-table am-table-striped am-table-hover table-main">
        <thead>
            <tr>
                <th class="table-type am-text-left" style="width:15%">
                   联系人姓名
                </th>
                <th class="table-title am-text-left" style="width:15%">
                    联系电话
                </th>
                <th class="table-title am-text-left" style="width:15%">
                    所在站点
                </th>
                <th class="table-title am-text-left" style="width:20%">
                    详细地址
                </th>
                <th class="table-set am-text-left" style="width:20%">
                    操作
                </th>
            </tr>
        </thead>
        <tbody>
            <notempty name="list">
                <foreach name="list" item="address">
                    <tr>
                        <td>
                            {$address.contact}
                        </td>
                        <td>
                            {$address.telphone}
                        </td>
                        <td>
                            {$siteList[$address['site_id']]['site_name']}
                        </td>
                        <td>
                            {$address.address}
                        </td>
                        <td>
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-xs">
                                    <a class="am-btn am-btn-default am-btn-xs am-text-secondary" 
                                    	href="{:U('editAddressAction?address_id='.$address['address_id'].'&user_id='.$userModel['user_id'])}">
                                    	<span class="am-icon-pencil-square-o"></span>编辑
                                    </a>
                                </div>
                            </div>
                        </td>
                    </tr>
                </foreach>
                <else/>
                <td colspan="9" class="text-center">
                    aOh! 暂时还没有内容!
                </td>
            </notempty>
        </tbody>
    </table>
    <!-- 分页 -->
    <ul class="am-pagination am-pagination-default am-no-layout amz-social">
        {$_page}
    </ul>
    <!-- /分页 -->
</block>
<block name="style">
    <style type="text/css">
        .am-table {
            padding-left: 0px;
            margin-left: 0px
        }
    </style>
</block>
